<script setup>
import { onMounted } from 'vue'
import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'

const props = defineProps({
  url: {
    type: String,
    default: ''
  },
  poster: {
    type: String,
    default: ''
  }
})

onMounted(() => {
  const player = new Player({
    id: 'mse',
    autoplay: false,
    width: '45rem',
    height: 400,
    url: props.url,
    poster: props.poster,
    playbackRate: [0.5, 0.75, 1, 1.5, 2] //传入倍速可选数组
  })
})
</script>
<template>
  <div id="mse"></div>
</template>
<style scoped lang="scss"></style>
